<?php
namespace Controller;

use Hoa\Registry\Registry;
use Library\Input;
use Library\Log;
use Library\View;


/**
 * LoginController
 * @author los_gsy
 */
class LoginController extends BaseController {
	/**
	 * 构造函数
	 */
	public function __construct() {
		parent::__construct();
	}


	/**
	 * test
	 */
	public function test() {
		echo __METHOD__, '<br />';
	}


	/**
	 * doLogin
	 */
	public function doLogin() {
		//cors
		header('Access-Control-Allow-Origin: *');

		//获取参数
		$username = Input::post('username', '');
		$passwd = Input::post('passwd', '');

		setcookie('username', $username, time() + 86400);

		$conf = Registry::get('conf');
		$ret = $conf['status'][200];

		exit(json_encode($ret));
	}


}